package ${repositoryImplPackage};

import com.paic.pafa.biz.dao.BaseDAO;
import com.paic.pafa.biz.dao.DAOException;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import ${repositoryPackage}.${className}Dao;
import ${modelPackage}.${className};


/**
 * ${description}
 * @author liuyonggang
 * @date 2014-11-12
 */

@Repository
public class ${className}DaoImpl extends BaseDAO implements ${className}Dao {

	Logger logger=Logger.getLogger(${className}DaoImpl.class);

	@Override
	public List<${className}> queryPage${className}(Map<String, Object> param) throws DAOException {
	
		return (List<${className}>) this._queryForList("${className}.queryPage${className}", param);
	}

	@Override
	public int countBy${className}(Map<String, Object> param)throws DAOException {
	
		return this._getInt("${className}.countBy${className}", param);
	}

	@Override
	public void save${className}(${className} entity) throws DAOException {
	
		this._insert("${className}.save${className}", entity);
	}

	@Override
	public void delete${className}(${className} entity) throws DAOException {
	
		this._delete("${className}.delete${className}", entity);
	}

	@Override
	public void update${className}(${className} entity) throws DAOException {
	
		this._update("${className}.update${className}", entity);
	}

	@Override
	public ${className} find${className}(${className} entity) throws DAOException {
	
		return this._getDTO("${className}.find${className}", entity);
	}
	
}

